#include <cstdint>
#include <deque>
#include <iostream>
#include <istream>
#include <utility>
using ll = int64_t;

const ll maxn = 2e6+5;
ll n,m,v,d[maxn],p[maxn],ans=0;
std::deque<std::pair<ll, ll>> dq; // 价钱，剩余个数

int main(){
    std::iostream::sync_with_stdio(false);
    std::cin.tie(nullptr);

    std::cin>>n>>m>>v;
    for(ll i=1;i<=n;i++)std::cin>>d[i];
    for(ll i=1;i<=n;i++)std::cin>>p[i];

    for(ll i=1;i<=n;i++){
        const ll jdnp = p[i]-m*i;
        while(dq.size() && dq.back().first >= jdnp)dq.pop_back();
        dq.emplace_back(jdnp, d[i]+v);
        while(d[i]){
            if(dq.front().second > d[i]){
                ans+=(dq.front().first+i*m)*d[i];
                dq.front().second-=d[i];
                d[i]=0;
            }else if(dq.front().second == d[i]){
                ans+=(dq.front().first+i*m)*d[i];
                d[i]=0;
                dq.pop_front();
            }else{
                ans+=(dq.front().first+i*m)*dq.front().second;
                d[i]-=dq.front().second;
                dq.pop_front();
            }
        }
        dq.back().second=v;
    }
    std::cout<<ans<<"\n";
}